  IfNot ScriptExtenderNewerThan 0.0.17.0
	IfNot DialogYesNo "This mod requires Oblivion Script Extender v0017 or higher. OBSE must be installed before this mod can be used.%NewLine%%NewLine%Do you want to continue installation?" "WARNING - OBSE REQUIRED"
		FatalError
	EndIf
EndIf

DontInstallAnyDataFiles

AllowRunOnLines

If DialogYesNo "Do you want LightWeight Potions to recalculate the weight of potions placed in the world by Oblivion or mods, and not only the weight of player-made potions?" "Non-player made potions"
	SetVar nonPlayer 1
Else
	SetVar nonPlayer 0
EndIf

Select "Set potion weight" "0.0" "0.1" "|0.2" "0.3" "0.4" "0.5"
	Case 0.0
		SetVar weight 0
	Break
	Case 0.1
		SetVar weight 0.1
	Break
	Case 0.2
		SetVar weight 0.2
	Break
	Case 0.3
		SetVar weight 0.3
	Break
	Case 0.4
		SetVar weight 0.4
	Break
	Case 0.5
		SetVar weight 0.5
	Break
EndSelect

SetVar weightT 1
If Equal %nonPlayer% 1

	Message "LightWeight Potions can be set to NOT modify the weight of non-player made potions that have normal weight above a threshold value.%NewLine%%NewLine%This is because heavy potions often have a special purpose and are made heavy for a reason." "Potion weight threshold"

	Select "Set non-player weight threshold" "1" "2" "3" "None"
		Case 1
			SetVar weightT 1
		Break
		Case 2
			SetVar weightT 2
		Break
		Case 3
			SetVar weightT 3
		Break
		Case None
			SetVar weightT 0
		Break
	EndSelect
EndIf


SelectWithDescriptions "Ini file placement",\
	"In Data\\ folder" "Ini file is placed in the Data\\ folder.",\
	"|In Data\\Ini\\ folder" "Ini file is placed in the Data\\Ini\\ folder. This folder is used by several different mods for storage of ini files."
	Case In Data\ folder
		InstallDataFile "Lightweight Potions.ini"
		Message "Lightweight Potions is fully configurable by editing Lightweight Potions.ini in the Oblivion\\Data folder." "Lightweight Potions Configuration"
	Break
	Case In Data\Ini\ folder
		CopyDataFile "Lightweight Potions.ini" "Ini\\Lightweight Potions.ini"
		Message "Lightweight Potions is fully configurable by editing Lightweight Potions.ini in the Oblivion\\Data\\Ini folder." "Lightweight Potions Configuration"
	Break
EndSelect

EditXMLReplace "Lightweight Potions.ini", "weight to 0.2", "weight to %weight%"
EditXMLReplace "Lightweight Potions.ini", "changeNonPlayerPotions to 0", "changeNonPlayerPotions to %nonPlayer%"
EditXMLReplace "Lightweight Potions.ini", "weight_threshold to 1.0", "weight_threshold to %weightT%"
